package ru.zhigulin.io.group;

import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import ru.zhigulin.io.ShootAndFun;
import ru.zhigulin.io.item.ModItems;

public class ModGroups {
    public static final String FOOD_ITEM_GROUP_KEY = "itemGroup.saf.food";
    public static final ItemGroup FOOD_ITEM_GROUP = FabricItemGroup.builder()
            .icon(() -> new ItemStack(ModItems.COOKED_MARSHMALLOW_ON_STICK))
            .displayName(Text.translatable(FOOD_ITEM_GROUP_KEY))
            .entries((displayContext, entries) -> {
                entries.add(ModItems.RAW_MARSHMALLOW);
                entries.add(ModItems.MARSHMALLOW_ON_STICK);
                entries.add(ModItems.COOKED_MARSHMALLOW_ON_STICK);
            })
            .build();

    public static void register() {
        Registry.register(
                Registries.ITEM_GROUP,
                new Identifier(ShootAndFun.MOD_ID, "food_item_group"),
                FOOD_ITEM_GROUP
        );
    }
}
